package com.summer.springboot_order_rabbitmq_consumer.service.topic;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.stereotype.Service;

@Service
@RabbitListener(bindings = @QueueBinding(
        value = @Queue(value = "duanxin.topic.queue",durable = "true",autoDelete = "false"),
        exchange = @Exchange(value = "topic_order_exchange",type = ExchangeTypes.TOPIC),
        key = "#.duanxin.#"
))
public class DuanxinTopicConsumer {
    @RabbitHandler
    public void receiveMessage(String message){
        System.out.println("duanxin topic---接收到了订单信息是: ->"+message);
    }
}
